package com.adwin.addcoin.ui.viewholder

import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.adwin.addcoin.R
import com.adwin.addcoin.databinding.HomeTaskItemBinding
import com.adwin.addcoin.repository.bean.HomeTaskBean
import com.bumptech.glide.Glide

class NewbieMissionHolder(val view:View): ViewHolder(view) {

    fun upDateTask(bean:HomeTaskBean){
        val imageView = view.findViewById<ImageView>(R.id.iv_task_icon)
        if (TextUtils.isEmpty(bean.taskType)||bean.taskType == "DAILY_TASK"){
            imageView.setImageResource(R.mipmap.newbie_mission_task_login)
        }else{
            imageView.setImageResource(R.mipmap.newbie_mission_task_new)
        }
        view.findViewById<TextView>(R.id.tv_task_coins).text = "${bean.coins}"
        view.findViewById<TextView>(R.id.tv_task_name).text = "${bean.appName?:""}"

    }
}